package demo2;

import demo1.Father;

public class Son extends Father {
    public void func() {
//        super.func();
//        System.out.println(super.a);
//        int k = this.a;
//        System.out.println(k);
//        Father father = new Son();
//        father.a;//error
//        father.func2;//error
//        int k = father.b;//true
//        super.func2();//true
        /*
        * 综上可知，protected 修饰的不可以之间 对象. 来访问，而是用super/this 来访问
        **/
        Father father = new Son();
        father.func3();//如果父类没有，而子类有，则编译不通过

    }

    @Override
    public void func3() {
        System.out.println("son func3");
    }
    public static void main(String[] args) {
        Son son = new Son();
        son.func();

    }
}
